package com.hrm.dao;

import com.hrm.entity.AdminEntity;
import com.hrm.util.PasswordUtil;
import org.apache.commons.collections.map.HashedMap;

import java.util.List;
import java.util.Map;

/**
 * Create by zekdot on 20-2-23.
 */
public class AdminDao extends BaseDao<AdminEntity> {

    public static void main(String args[]){
//        String sql = "INSERT INTO admin VALUES(?,?,?,?)";
//        Object params[] = {"001200","123456","test",12};
//        String sql = "SELECT * FROM admin WHERE id=?";
//        Object params[] = {"0012001"};
//        BaseDao baseDao = new AdminDao();
//        try {
////            baseDao.execute(sql,params);
//            AdminEntity t = (AdminEntity) baseDao.queryOne(sql,params);
//            System.out.println(t.getName());
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        AdminEntity adminEntity = new AdminEntity();
//        adminEntity.setId("zekdot");
//        adminEntity.setName("zekdot");
//        adminEntity.setAge(20);
//        adminEntity.setPassword(PasswordUtil.getMd5("123456"));
//        AdminDao adminDao = new AdminDao();
////        try {
////            adminDao.save(adminEntity);
////        } catch (Exception e) {
////            e.printStackTrace();
////        }
//        AdminEntity adminEntity = new AdminEntity();
//        try {
////            System.out.println(adminEntity.getAge());
////            System.out.println(adminEntity.getName());
////            adminEntity.setName("reflect");
////            adminEntity.setAge(10);
////            adminEntity.setPassword(PasswordUtil.getMd5("123456"));
////            adminEntity.setId("reflect");
////            adminDao.save(adminEntity);
//            adminEntity = adminDao.get("zekdot");
//            System.out.println(adminEntity.getName());
////            Map<String,Object> map = new HashedMap();
////            map.put("name","update");
////            adminDao.update("reflect",map);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

    }
}
